package org.zcl.elastic.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
import org.zcl.elastic.entity.User;

import java.util.List;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/7/19 10:52
 */
@Repository
public interface UserRepository extends ElasticsearchRepository<User, String> {

    List<User> findByAddressLikeIgnoreCaseOrderByAgeDesc(String adderss);

    Page<User> findByUserNameContaining(String userName, Pageable page);

    User findByAge(Integer age);

    List<User> findByGender(String gender);

    long count();

    Boolean existsById();
}
